<template>
    <div>
        <div>
            <h2>Home</h2>
            <!-- 打开历史记录的replace模式，将不能后退 -->
            <!-- <router-link :replace="true" active-class="active" to="/home/news">news</router-link> -->
            <!-- 可以简写成 -->
            <router-link replace active-class="active" to="/home/news">news</router-link>
            <router-link active-class="active" to="/home/message">message</router-link>
        </div>
        <div>
            <router-view></router-view>
        </div>
    </div>
</template>

<script>
    export default {
        name : "Home",
        // router被激活时
        activated() {
            console.log("Home被激活了")
        },
        // router被取消激活时
        deactivated() {
            console.log("Home被取消激活了")
        },
    }
</script>